'\" te
.\"  Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DDI_GET_DRIVER_PRIVATE 9F "Feb 17, 2023"
.SH NAME
ddi_get_driver_private, ddi_set_driver_private \- get or set the address of the
device's private data area
.SH SYNOPSIS
.nf
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>



\fBvoid\fR \fBddi_set_driver_private\fR(\fBdev_info_t *\fR\fIdip\fR, \fBvoid\fR *\fIdata\fR);
.fi

.LP
.nf
\fBvoid\fR *\fBddi_get_driver_private\fR(\fBdev_info_t *\fR\fIdip\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI).
.SH PARAMETERS
\fBddi_get_driver_private()\fR
.sp
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 7n
Pointer to device information  structure to get from.
.RE

.sp
.LP
\fBddi_set_driver_private()\fR
.sp
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 8n
Pointer to device information structure to set.
.RE

.sp
.ne 2
.na
\fB\fIdata\fR\fR
.ad
.RS 8n
Data area address to set.
.RE

.SH DESCRIPTION
The \fBddi_get_driver_private()\fR function returns the address of the device's
private data area from the device information structure pointed to by
\fIdip\fR.
.sp
.LP
The \fBddi_set_driver_private()\fR function sets the address of the device's
private data area in the device information structure pointed to by \fIdip\fR
with the value of \fIdata\fR.
.SH RETURN VALUES
The \fBddi_get_driver_private()\fR function returns the contents of
\fBdevi_driver_data\fR. If \fBddi_set_driver_private()\fR has not been
previously called with \fIdip\fR, an unpredictable value is returned.
.SH CONTEXT
These functions can be called from user, interrupt, or kernel context.
.SH SEE ALSO
\fIWriting Device Drivers\fR
